<?php
namespace Home\Controller;
use Think\Controller;
header("Content-type: text/html; charset=utf-8"); 
class IndexController extends Controller {
    public function index(){
    	$m = M("cate");
    	$typeList1 = $m->where('fid = 1')->join('ip_info ON ip_cate.id = ip_info.typeid')->page('1,5')->select();
    	$typeList2 = $m->where('fid = 1')->join('ip_info ON ip_cate.id = ip_info.typeid')->page('2,5')->select();
        $typeList3 = $m->where('fid = 2')->join('ip_info ON ip_cate.id = ip_info.typeid')->page('1,5')->select();
        $typeList4 = $m->where('fid = 2')->join('ip_info ON ip_cate.id = ip_info.typeid')->page('2,5')->select();
        $this->assign("typeList1",$typeList1);
    	$this->assign("typeList2",$typeList2);
        $this->assign("typeList3",$typeList3);
    	$this->assign("typeList4",$typeList4);

    	$m = M("cate");
    	$cateList1 = $m->where('fid = 1')->select();
    	$cateList2 = $m->where('fid = 2')->select();
    	$this->assign('cateList1',$cateList1);
    	$this->assign('cateList2',$cateList2);
        // var_dump($cateList1);
    	$this->display();
    }
}